/***************************************************************************
 *   Copyright (C) 2008 by Ryszard KrÃ³l   *
 *   rysiek.krol@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef PICTURELISTWIDGETITEM_H
#define PICTURELISTWIDGETITEM_H

#include <QListWidgetItem>

#include <QFileInfo>
#include <QDateTime>
#include <QSet>
#include <QImage>

/**
	@author Ryszard Krol <rysiek.krol@gmail.com>
*/



class PictureListWidgetItem : public QListWidgetItem
{

private:
    QFileInfo file;
    QDateTime time;
    QString note;
    QString place;
    QString commentString;
    QString shownName;
    QSet<QString> *keywords;
    QImage *iconImage;

    /**
     * Pobiera komentarz, miejsce i date z pliku xml
     * */
    void getDescription (const  QFileInfo &fileInfo );

    /**
     * Generuje Opis pod obrazkiem
     */
    void generateLabel();


    QString cutString(QString string);

public:
    /**
     * konstruktor
     */
    PictureListWidgetItem( QFileInfo & fileInfo,  QListWidget * parent = 0);

    /**
     *  konstruktor
     */
    PictureListWidgetItem(PictureListWidgetItem* item);

    /**
     *  konstruktor
     */
    PictureListWidgetItem( QFileInfo & fileInfo, QString name, QListWidget * parent = 0);

    /**
     * Destruktor
     */
    ~PictureListWidgetItem();

    QDateTime getDateTime();
    bool isDate();
    void setNote ( const QString& theValue );
    QString getNote() const;
    void setPlace ( const QString& theValue );
    QString getPlace() const;
    void setFile ( const QFileInfo& theValue );
    QFileInfo getFile() ;
    QString getCommentString() const;
    void setShownName(const QString& theValue);
    QString getShownName() const;
    QSet< QString >* getKeywords() const;

    void setKeywords(QSet< QString >* theValue);

    void setIconImage(QImage* theValue);


    QImage* getIconImage() const;

    void setTime(const QDateTime& theValue);


    QDateTime getTime() const;







};

#endif
